n = int(input())
for _ in range(n):
    s = input()
    print("|%s|" % s)
